.all-books {
  max-width: 1200px;
  margin: 0 auto;
  padding: 2rem;
}

.page-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 2rem;

  .ant-typography.ant-typography-h1 {
    margin: 0;
    color: #1e293b;
    font-size: 2rem;
  }
}

.filter-section {
  display: flex;
  gap: 1rem;
  margin-bottom: 2rem;
  flex-wrap: wrap; 

  .search-input.ant-input-affix-wrapper {
    width: 300px; 
    max-width: 100%; 
  }

  .ant-select {
    width: 180px; 
    flex-shrink: 0; 
  }
}

.books-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 2rem;
  margin-bottom: 2rem;
}

.book-card.ant-card {
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  border: 1px solid #e2e8f0;
  cursor: pointer;
  padding: 0; 

  .ant-card-body {
    padding: 0; 
  }

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0, 0, 0, 0.1);
  }

  .book-cover {
    position: relative;
    width: 100%;
    aspect-ratio: 3/4;
    overflow: hidden;

    img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      transition: transform 0.3s ease;
    }

    .book-hover {
      position: absolute;
      top: 0;
      left: 0;
      right: 0;
      bottom: 0;
      background: rgba(0, 0, 0, 0.5);
      display: flex;
      align-items: center;
      justify-content: center;
      opacity: 0;
      transition: opacity 0.3s ease;
    }
  }

  &:hover .book-hover {
    opacity: 1;
  }

  &:hover .book-cover img {
    transform: scale(1.05);
  }

  .book-info {
    padding: 1rem; 

    .book-title-text.ant-typography {
      margin: 0 0 0.5rem;
      font-size: 1rem;
      color: #1e293b;
      line-height: 1.4;
      height: 2.8em; 
      overflow: hidden;
      display: -webkit-box;
      -webkit-line-clamp: 2;
      -webkit-box-orient: vertical;
    }
  }

  .book-meta {
    display: flex;
    gap: 0.5rem;
    margin-bottom: 0.5rem;
    font-size: 0.875rem;

    .book-author.ant-typography {
      color: #64748b;
    }

    .book-category.ant-tag {
      color: #3b82f6;
      background: #eff6ff;
      padding: 0.125rem 0.5rem;
      border-radius: 4px;
    }
  }

  .book-rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;

    .stars.ant-rate {
      font-size: 0.875rem; 
      li {
        margin-inline-end: 2px; 
      }
      .ant-rate-star-full .anticon {
        color: #f59e0b;
      }
    }

    .rating-value.ant-typography {
      color: #f59e0b;
      font-weight: 500;
      font-size: 0.875rem;
    }
  }

  .book-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;

    .book-price.ant-typography {
      color: #ef4444;
      font-weight: 600;
      font-size: 1.125rem;
    }

    .book-sales.ant-typography {
      color: #64748b;
      font-size: 0.875rem;
    }
  }
}

.pagination-section {
  display: flex;
  justify-content: center;
  margin-top: 2rem;
}

.loading-state,
.error-state {
  text-align: center;
  padding: 2rem;
  margin: 2rem auto;
  max-width: 600px;
}

.error-state .ant-alert {
  color: #dc2626;
  background: #fee2e2;
  border-radius: 8px;
  padding: 1rem;
}

@media (max-width: 768px) {
  .all-books {
    padding: 1rem;
  }

  .filter-section {
    flex-direction: column;
    gap: 0.75rem; 
  }

  .search-input.ant-input-affix-wrapper {
    width: 100%;
  }

  .ant-select {
    width: 100% !important; 
  }

  .books-grid {
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 1rem;
  }
}